import request from '@/utils/request';

/******* 
 * @description: 获取API每日统计数据
 * @param {*} params
 * @return {*}
 */
export function getApiStats(params) {
  return request({
    url: '/backend/log/api-stats',
    method: 'get',
    params
  });
}

/******* 
 * @description: 获取API失败请求详情
 * @param {*} params
 * @return {*}
 */
export function getApiFailLogs(params) {
  return request({
    url: '/backend/log/api-fail-logs',
    method: 'get',
    params
  });
}

/******* 
 * @description: 获取API慢请求详情
 * @param {*} params
 * @return {*}
 */
export function getApiSlowLogs(params) {
  return request({
    url: '/backend/log/api-slow-logs',
    method: 'get',
    params
  });
}

/******* 
 * @description: 获取API统计概览（按日期分组）
 * @param {*} params
 * @return {*}
 */
export function getApiStatsOverview(params) {
  return request({
    url: '/backend/log/api-stats-overview',
    method: 'get',
    params
  });
}


/******* 
 * @description: 实时统计
 * @return {*}
 */
export function triggerApiLogProcessing(params) {
  return request({
    url: '/backend/log/trigger-api-log-processing',
    method: 'get',
    params
  });
}
